#ifndef FILTER_H
#define FILTER_H

#include <QObject>
#include <QImage>

class Filter : public QObject
{
    Q_OBJECT

public:
    Filter(int size = 5);
    virtual ~Filter() { }

    void setSize(int size);
    QImage filtered(const QImage &image);

public slots:
    void cancel();

signals:
    void progress(int value);

protected:
    virtual QImage doFiltering(const QImage &image) = 0;
    virtual void doSetSize(int size) { };

    int m;
    bool wasCanceled;
};

#endif
